use serde::{Deserialize, Serialize};
use crate::common::Sex;
#[derive(Debug, Serialize,Deserialize)]
pub struct User{
    pub account: String,
    pub password: String,
    pub nickname: Option<String>,
    pub photo: Option<String>,
    pub sex:Option<Sex>,
}

impl User{
    pub fn new(account: String, password: String) -> Self{
        User{
            account,
            password,
            nickname: None,
            photo: None,
            sex: None,
        }
    }
}

impl PartialEq for User{
    fn eq(&self, other: &Self) -> bool {
        self.account == other.account
    }
}